﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using VMuktiAPI;

namespace VMuktiGrid.Buddy
{
    /// <summary>
    /// Interaction logic for addBuddy.xaml
    /// </summary>
    public partial class ctlBuddy : UserControl
    {
        public ctlBuddy()
        {
            try
            {
                InitializeComponent();
                txtTitle.MouseDown += new System.Windows.Input.MouseButtonEventHandler(txtTitle_MouseDown);
            }
            catch (Exception ex)
            {
                ex.Data.Add("My Key", "ctlBuddy()--:--ctlBuddy.xaml.cs--:--" + ex.Message + " :--:--");
                ClsException.LogError(ex);
                ClsException.WriteToErrorLogFile(ex);
            }
        }
       
        #region Public Properties

        public string Title
        {
            set
            {
                txtTitle.Text = value;
            }
            get
            {
                return txtTitle.Text;
            }
        }

        #endregion

        #region Private Members

        private void txtTitle_MouseDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
        {

        }

        #endregion

        private void imgDelete_PreviewMouseDown(object sender, MouseButtonEventArgs e)
        {
            try
            {
                ((StackPanel)this.Parent).Children.Remove(this);
            }
            catch (Exception ex)
            {
                ex.Data.Add("My Key", "imgDelete_PreviewMouseDown()--:--ctlBuddy.xaml.cs--:--" + ex.Message + " :--:--");
                ClsException.LogError(ex);
                ClsException.WriteToErrorLogFile(ex);
            }
        }
    }
}
